<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 函数柯里化表现：多参函数，变成函数嵌套，子函数用父函数变量

    // 原来求和
    function add(x,y){
        return x+y;
    }
    console.log(add(1,2));

    function add2(x){
        return function (y){
            return x+y;
        }
    }


    let res = add2(1)(2);
    console.log(res)

</script>
</html>